package cn.zl.web.dto.device;

import cn.yunbamboos.rest.service.anno.param.ParamType;
import cn.yunbamboos.rest.service.anno.param.enums.Type;
import cn.yunbamboos.rest.service.dto.in.GenericInDTO;
import cn.zl.model.Device;
import com.alibaba.fastjson2.JSONObject;
import jakarta.validation.constraints.NotNull;

public class AddDeviceInDTO extends GenericInDTO {

    @NotNull(message = "国标设备信息不能为空")
    @ParamType(path = "device", type = Type.Object, title = "国标设备信息", required = true)
    private Device device;

    @Override
    public void decode(JSONObject json) {
        super.decode(json);
        this.device = this.getModel(json, "device", Device.class);
    }

    public Device getDevice() {
        return this.device;
    }

}
